/*
 * HelloWorld
 */

#include "HelloWorld.h"
#include "fatal.h"

static HelloWorld HelloWorldImpl;
Robot* gRobot = &HelloWorldImpl;

HelloWorld::HelloWorld() : Property(),
	// Modules
    mBlink(),

    // Remote control
    mAvrUsart(),
    mPacket(&mAvrUsart),
    mBridge(&mPacket),
    mServer(this, &mBridge)
{
	mBridge.registerServer(&mServer);
}

void HelloWorld::onStart() {
	mBlink.mEnabled = true;
}

Property* HelloWorld::getChild(unsigned char index) {
	switch(index) {
	case 0: return &mBlink;
	default: return 0;
	}
}
